package com.easyad.manage;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import com.easyad.hibernate.AdAudit;
import com.easyad.pub.hibernateDatabaseClass;

public class auditManage {

	public static void log(int adid, String adname, int qybm, String qymc, String opt, String adresult, String adxplain) {
		
		AdAudit audit = new AdAudit();
		
		audit.setAdid(adid);
		audit.setAdname(adname);
		audit.setQybm(qybm);
		audit.setCommany(qymc);
		audit.setAdman(opt);
		audit.setAdresult(adresult);
		audit.setAdexplain(adxplain);
		audit.setAdnode("0");
		audit.setAdate(new Timestamp((new Date()).getTime()));
		
		hibernateDatabaseClass.save(audit);
	}
	
	public static List getLog(int adid){
		
		List l =  hibernateDatabaseClass.getList("from AdAudit t where t.adid = "+adid+" order by t.aid");
		return l;
	}
}
